home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Utilities ƒ / MPW Tools ƒ / Simula4.07 / Simula 4.07ƒ / Scripts / simld < prev   
Encoding:
Text File  |  1989-04-26  |  1.4 KB  |  74 lines  |  [TEXT/MPS ]

  1. set linkfiles ""
  2. set linkfilenames ""
  3. set options ""
  4. set main ""
  5. set mainname ""
  6. set APPL ""
  7. set toolbox ""
  8.  
  9. for i in {parameters}
  10.     if "{i}" == "-APPL"
  11.         set APPL "-t APPL"
  12.     else if "{i}" == "-toolbox"
  13.         set toolbox "{libraries}toolbox.o"
  14.     else if "{i}" !~ /-≈/
  15.         if "{i}" =~ /≈.[pca].o/
  16.             set linkfiles "{linkfiles} {i}"
  17.             set linkfilenames "{linkfilenames} {i}"
  18.         else
  19.         begin        
  20.             if "{i}" !~ /≈.sim.o/
  21.                 set i "{i}.sim.o"
  22.             end if
  23.             if {main} != ""
  24.                 set linkfiles "{linkfiles} {i}"
  25.                 if {i} =~ /(≈)®1.sim.o/
  26.                     set linkfilenames "{linkfilenames} {®1}"
  27.                 end if
  28.             else
  29.                 set main {i}
  30.             end if
  31.         end
  32.         end if
  33.     else
  34.         set options "{options} {i}"
  35.     end if
  36. end for
  37.  
  38. if {main} =~ /(≈)®1.sim.o/
  39.     set mainname "{®1}"
  40. else
  41.     set mainname {main}
  42. end if
  43.  
  44. echo -n "Iinking {mainname} "
  45. if "{linkfiles}" <> 0
  46.     echo with: {linkfilenames}
  47. else
  48.     echo
  49. end if
  50.  
  51. if "{APPL}" == ""
  52.     Link  -w -t MPST -c 'MPS ' {options} ∂
  53.         {main} ∂
  54.         {linkfiles} ∂
  55.         {toolbox} ∂
  56.         {libraries}simrtslib ∂
  57.         {libraries}runtime.o ∂
  58.         {libraries}interface.o ∂
  59.         -o {mainname} 
  60. else
  61.     echo    as an application
  62.     Link  -w  {APPL} {options} ∂
  63.         {main} ∂
  64.         {linkfiles} ∂
  65.         {libraries}simulastandalone.a.o ∂
  66.         {libraries}simulainterface.p.o  ∂
  67.         {libraries}APPL_terminal.a.o ∂
  68.         {libraries}APPL_othersvc.a.o ∂
  69.         {toolbox} ∂
  70.         {libraries}simrtslib ∂
  71.         {libraries}runtime.o ∂
  72.         {libraries}interface.o ∂
  73.         -o {mainname} 
  74. end if